2023-03-08    Share on: Twitter | Facebook | HackerNews | Reddit

Yapf Toml Package Is Needed for Using pyproject.toml as a Configuration File

if you are getting error:

yapf: toml package is needed for using pyproject.toml as a configuration file

you can use:

-   repo: https://github.com/pre-commit/mirrors-yapf
    rev: v0.31.0
    hooks:
    -   id: yapf
        additional_dependencies: [toml]

solution from user asottile https://github.com/pre-commit/mirrors-yapf/issues/15#issuecomment-814037905

X::Which Python Code Formatter Is Better - Black or Yapf? X::Black - The Code Formatter